package com.huitone.smspfm.core.constant;

import com.bin.common.utils.StringUtils;
import com.huitone.smspfm.core.config.AppStaticConfigs;

/**   
* @Title DealResult.java 
* @Package com.huitone.smspfm.core.constant 
* @Description TODO(用一句话描述该文件做什么) 
* @author ybliang   
* @date 2017年4月26日 上午10:54:24 
* @version V1.0   
*/
public class DealResult {

	/**
	 * 成功
	 */
	public static int RESULT0 = 0;
	public static byte[] RESULT0B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT0));
	
	public static String RESULT0_DESC = "成功";
	public static byte[] RESULT0_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT0_DESC);
	
	/**
	 * 
	 */
	public static int RESULT1 = 1;
	public static byte[] RESULT1B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT1));
	
	public static String RESULT1_DESC = "失败";
	public static byte[] RESULT1_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT1_DESC);
	
	/**
	 * 
	 */
	public static int RESULT2 = 2;
	public static byte[] RESULT2B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT2));
	
	public static String RESULT2_DESC = "";
	public static byte[] RESULT2_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT2_DESC);
	
	/**
	 * 
	 */
	public static int RESULT3 = 3;
	
	public static String RESULT3_DESC = "";
	
	/**
	 * 
	 */
	public static int RESULT4 = 4;
	
	public static String RESULT4_DESC = "";
	
	/**
	 * 
	 */
	public static int RESULT5 = 5;
	
	public static String RESULT5_DESC = "";
	
	/**
	 * 非法手机号码
	 */
	public static int RESULT6 = 6;
	
	public static String RESULT6_DESC = "";
	
	/**
	 * 
	 */
	public static int RESULT7 = 7;
	
	public static String RESULT7_DESC = "";
	
	/**
	 * 
	 */
	public static int RESULT8 = 8;
	
	public static String RESULT8_DESC = "";
	
	/**
	 * 
	 */
	public static int RESULT9 = 9;
	
	public static String RESULT9_DESC = "";
	
	/**
	 * 
	 */
	public static int RESULT10 = 10;
	
	public static String RESULT10_DESC = "";
	
	/**
	 * 
	 */
	public static int RESULT11 = 11;
	
	public static String RESULT11_DESC = "附加短信";
	
	/**
	 * 
	 */
	public static int RESULT_1 = -1;
	public static byte[] RESULT_1B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT_1));
	
	public static String RESULT_1_DESC = "禁发时段";
	public static byte[] RESULT_1_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT_1_DESC);
	
	/**
	 * 重复短信
	 */
	public static int RESULT_2 = -2;
	public static byte[] RESULT_2B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT_2));
	
	public static String RESULT_2_DESC = "重复短信";
	public static byte[] RESULT_2_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT_2_DESC);
	
	/**
	 * 包含敏感词短信
	 */
	public static int RESULT_3 = -3;
	public static byte[] RESULT_3B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT_3));
	
	public static String RESULT_3_DESC = "包含敏感词短信";
	public static byte[] RESULT_3_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT_3_DESC);
	
	/**
	 * 黑名单用户短信
	 */
	public static int RESULT_4 = -4;
	public static byte[] RESULT_4B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT_4));
	
	public static String RESULT_4_DESC = "黑名单用户短信";
	public static byte[] RESULT_4_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT_4_DESC);
	
	/**
	 * 无效用户短信
	 */
	public static int RESULT_5 = -5;
	public static byte[] RESULT_5B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT_5));
	
	public static String RESULT_5_DESC = "无效用户短信";
	public static byte[] RESULT_5_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT_5_DESC);
	
	/**
	 * 用户号码不合法
	 */
	public static int RESULT_6 = -6;
	public static byte[] RESULT_6B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT_6));
	
	public static String RESULT_6_DESC = "用户号码不合法";
	public static byte[] RESULT_6_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT_6_DESC);
	
	/**
	 * 业务端没有业务类型错误
	 */
	public static int RESULT_7 = -7;
	public static byte[] RESULT_7B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT_7));
	
	public static String RESULT_7_DESC = "业务端没有业务类型错误";
	public static byte[] RESULT_7_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT_7_DESC);
	
	/**
	 * 短信发送端口号(扩展码)不匹配错误
	 */
	public static int RESULT_8 = -8;
	public static byte[] RESULT_8B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT_8));
	
	public static String RESULT_8_DESC = "短信发送端口号(扩展码)不匹配错误";
	public static byte[] RESULT_8_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT_8_DESC);
	
	/**
	 * 未匹配到网关
	 */
	public static int RESULT_9 = -9;
	public static byte[] RESULT_9B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT_9));
	
	public static String RESULT_9_DESC = "未匹配到网关";
	public static byte[] RESULT_9_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT_9_DESC);
	
	/**
	 * 未匹配到优先级队列
	 */
	public static int RESULT_11 = -11;
	public static byte[] RESULT_11B = AppStaticConfigs.stringRedisSerializer.serialize(StringUtils.toString(RESULT_11));
	
	public static String RESULT_11_DESC = "未匹配到优先级队列";
	public static byte[] RESULT_11_DESCB = AppStaticConfigs.stringRedisSerializer.serialize(RESULT_11_DESC);
	
	public static String codeDesc(int code) {
		
		String result = null;
		
		switch (code) {
		case 0:
			result = RESULT0_DESC;
			break;
		case 1:
			result = RESULT1_DESC;
			break;
		case 2:
			result = RESULT2_DESC;
			break;
		case 3:
			result = RESULT3_DESC;
			break;
		case 4:
			result = RESULT4_DESC;
			break;
		case 5:
			result = RESULT5_DESC;
			break;
		case 6:
			result = RESULT6_DESC;
			break;
		case 7:
			result = RESULT7_DESC;
			break;
		case 8:
			result = RESULT8_DESC;
			break;
		case 9:
			result = RESULT9_DESC;
			break;
		case 10:
			result = RESULT10_DESC;
			break;
		case 11:
			result = RESULT11_DESC;
			break;
		case -1:
			result = RESULT_1_DESC;
			break;
		case -2:
			result = RESULT_2_DESC;
			break;
		case -3:
			result = RESULT_3_DESC;
			break;
		case -4:
			result = RESULT_4_DESC;
			break;
		case -5:
			result = RESULT_5_DESC;
			break;
		case -6:
			result = RESULT_6_DESC;
			break;
		case -7:
			result = RESULT_7_DESC;
			break;
		case -8:
			result = RESULT_8_DESC;
			break;
		case -9:
			result = RESULT_9_DESC;
			break;
		case -11:
			result = RESULT_11_DESC;
			break;
		}
		
		return result;
	}
	
	public static byte[] codeDescB(int code) {
		
		byte[] result = null;
		
		switch (code) {
		case 0:
			result = RESULT0_DESCB;
			break;
		case 1:
			result = RESULT1_DESCB;
			break;
		case 2:
			result = RESULT2_DESCB;
			break;
		case -1:
			result = RESULT_1_DESCB;
			break;
		case -2:
			result = RESULT_2_DESCB;
			break;
		case -3:
			result = RESULT_3_DESCB;
			break;
		case -4:
			result = RESULT_4_DESCB;
			break;
		case -5:
			result = RESULT_5_DESCB;
			break;
		case -6:
			result = RESULT_6_DESCB;
			break;
		case -7:
			result = RESULT_7_DESCB;
			break;
		case -8:
			result = RESULT_8_DESCB;
			break;
		case -9:
			result = RESULT_9_DESCB;
			break;
		case -11:
			result = RESULT_11_DESCB;
			break;
		}
		
		return result;
	}
}
